﻿#include "geowindow.h"
#include<QAction>
#include<QToolBar>
GeoWindow::GeoWindow(QWidget *parent) : QMainWindow(parent)
{
    resize(800,600);
    m_gow.setParent(this);
    m_gow.setWindowTitle(QString::fromLocal8Bit("操作区域"));
    m_gdWidget.setParent(this);
    m_gdWidget.setWindowTitle("绘图区域");
    QDockWidget *rightDock = new QDockWidget(this);
    rightDock->setFeatures(QDockWidget::DockWidgetFloatable);
    rightDock->setWindowTitle("属性区域");
    rightDock->setAllowedAreas(Qt::RightDockWidgetArea);
    addDockWidget(Qt::RightDockWidgetArea,rightDock);

    setCentralWidget(&m_gdWidget);
    QDockWidget *leftDock = new QDockWidget(this);
    leftDock->setFeatures(QDockWidget::DockWidgetFloatable);
    leftDock->setWindowTitle("left");
    leftDock->setAllowedAreas(Qt::LeftDockWidgetArea
                              | Qt::BottomDockWidgetArea);
    leftDock->setWidget(&m_gow);
    addDockWidget(Qt::LeftDockWidgetArea,leftDock);
    initToolBar();
}

void GeoWindow::initToolBar()
{
    QAction *openAction = new QAction(tr("&Open"), this);
    openAction->setShortcut(QKeySequence::Open);
    openAction->setStatusTip(tr("Open a file."));
    QToolBar *toolBar = addToolBar(tr("&File"));
    toolBar->addAction(openAction);

    QAction *editAction = new QAction(tr("&Edit"), this);
    editAction->setShortcut(QKeySequence::Close);
    editAction->setStatusTip(tr("Edit a file."));
    //toolBar = addToolBar(tr("&Edit"));
    toolBar->addAction(editAction);

}

